package org.joinme.backend.mapper;

import org.apache.ibatis.annotations.Param;
import org.joinme.backend.model.ApplicationCarPoolingRecord;
import org.joinme.backend.model.ApplicationRecord;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Repository
@Transactional
public interface ApplicationRecordMapper {

    ApplicationRecord selectByPrimaryKey(@Param("userId") int userId, @Param("carPoolingId") int carPoolingId);

    List<ApplicationCarPoolingRecord> selectByUserId(@Param("userId") int userId, @Param("start") int start, @Param("limit") int limit);

    int countByUserId(int userId);

    int deleteByPrimaryKey(@Param("userId") int userId, @Param("carPoolingId") int carPoolingId);

    int insert(ApplicationRecord record);

    int insertSelective(ApplicationRecord record);

    int updateByPrimaryKeySelective(ApplicationRecord record);

    int updateByPrimaryKey(ApplicationRecord record);

    int updateStatus(@Param("userId") int userId, @Param("carPoolingId") int carPoolingId, @Param("participateStatus") int participateStatus);
}
